<#macro layout>
<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
<!--     <link rel="icon" href="../../favicon.ico"> -->

    <title>阿猴的花果山</title>
	<link rel="shortcut icon" href="${path}/favicon.ico"/> 
    <!-- Bootstrap core CSS -->
<!--     <link href="${path}/css/bootstrap.min.css" rel="stylesheet"> -->
	<link href="http://libs.baidu.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="${path}/css/dashboard.css" rel="stylesheet">
<!-- 	<script src="${path}/js/jquery-1.11.1.min.js"></script> -->
	<script src="http://libs.baidu.com/jquery/1.10.0/jquery.min.js"></script>
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="${domain}" target="_blank">Binary Life</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="${path}/admin/logout.html">Logout</a></li>
          </ul>
        </div>
      </div>
    </div>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
            <li><a href="${path}/admin/article/">博文管理</a></li>
            <li><a href="${path}/admin/project/">类别管理</a></li>
            <li><a href="${path}/admin/message/">留言管理</a></li>
          </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <#nested>
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--     <script src="${path}/js/bootstrap.min.js"></script> -->
	<script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
  </body>
</html>
</#macro>

<!-- 分页工具条 -->
<#macro pagination prefix="" pageNum=1 totalPage=1>
	<#if totalPage == 0>
		<#assign _totalPage = 1 />
	<#else>
		<#assign _totalPage = totalPage />
	</#if>
	<#if _totalPage != 1>
	<ul class="pagination center-block">
		<#if pageNum == 1>
			<li><a href="javascript:;" class="disabled"><span class="glyphicon glyphicon-step-backward"></span></a></li>
			<li><a href="javascript:;" class="disabled"><span class="glyphicon glyphicon-chevron-left"></span></a></li>
		<#else>
			<li><a href="?p=1${prefix}"><span class="glyphicon glyphicon-step-backward"></span></a></li>
			<li><a href="?p=${pageNum-1}${prefix}"><span class="glyphicon glyphicon-chevron-left"></span></a></li>
		</#if>
		<#if ( _totalPage - pageNum ) gt 6>
			<#assign endIndex = ( pageNum + 6) />
		<#else>
			<#assign endIndex = _totalPage />
		</#if>
		<#if ( pageNum - 3 ) gt 0>
			<#assign startIndex = ( pageNum - 3) />
		<#else>
			<#assign startIndex = 1 />
		</#if>
		<#list startIndex..endIndex as _pageNum>
		<li>
			<#if _pageNum == pageNum>
				<a href="javascript:;" class="active">${_pageNum}</a>
			<#else>
				<a href="?p=${_pageNum}${prefix}">${_pageNum}</a>
			</#if>

		</li>
		</#list>
		<#if pageNum == _totalPage>
			<li><a href="javascript:;" class="disabled"><span class="glyphicon glyphicon-chevron-right"></span></a></li>
			<li><a href="javascript:;" class="disabled"><span class="glyphicon glyphicon-step-forward"></span></a></li>
		<#else>
			<li><a href="?p=${pageNum+1}${prefix}"><span class="glyphicon glyphicon-chevron-right"></a></li>
			<li><a href="?p=${_totalPage}${prefix}"><span class="glyphicon glyphicon-step-forward"></span></a></li>
		</#if>
	</ul>
	</#if>
</#macro>